package com.shanghaionstar.utils;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;

/**
 * Created by 6335yz on 2016/7/20.
 */
public class ConnectBroad extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
//        ConnectivityManager connectMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//        NetworkInfo mobNetInfo = connectMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
//        NetworkInfo wifiNetInfo = connectMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
//        if (!mobNetInfo.isConnected() && !wifiNetInfo.isConnected()) {
//            Log.i("ConnectBroad", "unconnect");
//        } else {
//            Log.i("ConnectBroad", "connect");
//            NavHolder.getInstance(context).findMyLocation();
//        }
    }
}
